package com.jinzhi.jzweb.utils;

public class EfficacyUtil {

    /**
     *图片判断
     * */
    public static boolean isPhoto(String fileName){
        int len = fileName.length();
        if(len<=4)
            return false;
        if(fileName.substring(len-4,len).equals(".jpg")||fileName.substring(len-4,len).equals(".JPG"))
            return true;
        if(fileName.substring(len-4,len).equals(".png")||fileName.substring(len-4,len).equals(".PNG"))
            return true;
        if(fileName.substring(len-5,len).equals(".jpeg")||fileName.substring(len-4,len).equals(".JPEG"))
            return true;
        return false;
    }

    public static void main(String[] args) {
        String fileName = "12312312312312.JPG";
        System.out.println(EfficacyUtil.isPhoto(fileName));
    }
}
